<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition template="../WEB-INF/template_admin.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreateCategoriaTitle}"></h:outputText>
        </ui:define>
        <ui:define name="content">
            <div class="content">
                <br />
                <ul class="lista-mapa-sitio">
                    <li><a href="#{request.contextPath}/faces/administrador.xhtml">Administrar</a> / </li>
                    <li><a href="#{request.contextPath}/faces/categoria/CategList.xhtml">Categorias</a> / </li>
                    <li>Crear Categorias</li>
                </ul>
                <p:panel header="Crear nueva categoría" style="width: 600px" styleClass="panel-usuario">
                    
                    <p:growl id="growl" life="2000"/>
                    <h:panelGroup id="messagePanel" layout="block">
                        <p:messages autoUpdate="true"/>
                    </h:panelGroup>
                    <h:form>
                        <div class="cat_info">
                            <h:panelGrid columns="2">
                                <h:outputLabel value="#{bundle.CreateCategoriaLabel_nombre}" for="nombre" />
                                <p:inputText id="nombre" value="#{categoriaController.selected.catNombre}" title="#{bundle.CreateCategoriaTitle_nombre}" required="true" requiredMessage="#{bundle.CreateCategoriaRequiredMessage_nombre}">
                                    <f:validateLength maximum="10" />
                                </p:inputText>
                                <h:outputLabel value="#{bundle.CreateCategoriaLabel_tamano}" for="tamano" />
                                <p:selectOneMenu id="tamano" value="#{categoriaController.selected.catSize}" required="true" requiredMessage="#{bundle.CreateCategoriaRequiredMessage_tamano}">
                                    <f:selectItem itemLabel="Seleccionar Tamaño" />
                                    <f:selectItem id="item1" itemLabel="Pequeño" itemValue="Pequeño"/>
                                    <f:selectItem id="item2" itemLabel="Mediano" itemValue="Mediano"/>
                                    <f:selectItem id="item3" itemLabel="Grande" itemValue="Grande"/>
                                </p:selectOneMenu>
                                <h:outputLabel value="#{bundle.CreateCategoriaLabel_precio}" for="precio" />
                                <p:inputText id="precio" value="#{categoriaController.selected.catPrecio}" title="#{bundle.CreateCategoriaTitle_precio}" required="true" requiredMessage="#{bundle.CreateCategoriaRequiredMessage_precio}">
                                    <f:validateDoubleRange minimum="1"/>
                                </p:inputText>
                                
                            </h:panelGrid>
                            <br />
                        </div><!-- end of cat_info -->
                        <br/>
                        <p:commandLink actionListener="#{categoriaController.create}" value="#{bundle.CreateCategoriaSaveLink}" update=":growl" />
                        <br/>
                        <br/>
                        <h:commandLink styleClass="jsfcrud_commandlinks_action" action="#{categoriaController.prepareList}" value="#{bundle.CreateCategoriaShowAllLink}" immediate="true"/>
                        <br/>
                        <br/>
                    </h:form>
                </p:panel>
            </div><!-- end of content -->
        </ui:define>
    </ui:composition>

</html>
